<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="newstyle.css" >
<meta http-equiv="Content-Type" content="text/html;
  charset=iso-8859-1" >
<title>Root Rational Fraction Calculator</title>
</head>
<body>

<div id="top">
<h2>Anthony Stone's RRF Calculator</h2>
</div>
<div id="trail">
<p><a href="http://www-stone.ch.cam.ac.uk/">Home</a>
 -> <a href="http://www-stone.ch.cam.ac.uk/programs.html">Programs</a>
 -> <a href="index.html">RRF</a>
 -> RRFcalc</p>
</div>

<!-- Index starts here -->
<div id="index">
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/index.html">Home</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/personal/personal.html">Personal information</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/programs.html">Computer programs</a></p>
<p class="indexentry"><a
href="http://www.ch.cam.ac.uk/staff/ajs.html">Research details</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/personal/timf.html">The Theory of Intermolecular Forces</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/personal/bibliography.html">Publications</a></p>
<p class="indexentry"><a href="http://www-stone.ch.cam.ac.uk/personal/supplementary.html">
Supplementary material for published papers</a></p>
</div>
<!-- Index ends here -->


<div id="content">
<p><strong>RRFcalc</strong> reads input a
line at a time and treats it as commands for a 
calculator working in <a href="rpn.html">Reverse Polish
Notation</a>. It is convenient for interactive use, but it can be used
non-interactively by supplying a file of commands as standard
input.</p>

<p>After each line of input has been processed, the top
item on the stack is displayed, unless the last command already
displayed it. The commands available are:</p>

<table>
<tr valign="top"><td><i>integer</i></td>
<td>read the integer (which must be non-negative) and put it on the stack. To
get a negative number on the stack, you need to read in a positive number
and use <a href="#chs">CHS</a> to change the sign. </td></tr>
<tr valign="top"><td>PP <i>rrf</i> </td>
<td>read the rest of the line as a root-rational-fraction in
<a href="pp.html">power-of-prime form</a>, and put it on the stack. </td></tr>
<tr valign="top"><td>+ </td>
<td>Add: replace the top two elements on the stack by their sum. </td></tr>
<tr valign="top"><td>- </td>
<td>Subtract (top-of-stack from the one below). To change the sign of
the top-of-stack, use <a href="#chs">CHS</a>. </td></tr>
<tr valign="top"><td>* </td>
<td>Multiply </td></tr>
<tr valign="top"><td>/ </td>
<td>Divide (top-of-stack into the one below) </td></tr>
<tr valign="top"><td>POWER <i>n</i> </td>
<td>raise to power <i>n</i> (<i>n</i> = integer or integer/2). </td></tr>
<tr valign="top"><td>SQRT </td>
<td>= POWER 1/2. Note that it is an error to take the square root of a number
which already contains half-odd-integer powers. </td></tr>
<tr valign="top"><td><a id="chs">CHS</a> </td>
<td>change sign </td></tr>
<tr valign="top"><td>SWOP, SWAP </td>
<td>exchange top two items of stack </td></tr>
<tr valign="top"><td>STO <i>n</i> </td>
<td>Store top-of-stack in memory <i>n</i> (1 &#8804; <i>n </i> &#8804; 25).
The item is not removed from the stack. </td></tr>
<tr valign="top"><td>RCL <i>n</i> </td>
<td>Recall from memory <i>n</i> to top-of-stack. </td></tr>
<tr valign="top"><td>V </td>
<td>Verify top of stack. </td></tr>
<tr valign="top"><td>LIST </td>
<td>List the entire stack using the current default verification mode.
Top of stack is shown first. </td></tr>
<tr valign="top"><td>VP </td>
<td>Verify top-of-stack in power-of-prime notation </td></tr>
<tr valign="top"><td>VI </td>
<td>Verify top-of-stack as (<i>a</i>/<i>b</i>)*sqrt(<i>c</i>/<i>d</i>),
where <i>a</i>, <i>b</i>, <i>c</i> and <i>d</i> are integers (standard
default). </td></tr>
<tr valign="top"><td>VF </td>
<td>Verify top-of-stack as a floating-point number. </td></tr>
<tr valign="top"><td>VMP </td>
<td>Change default verification mode to power-of-prime. </td></tr>
<tr valign="top"><td>VMI </td>
<td>Change default verification mode to 
(<i>a</i>/<i>b</i>)*sqrt(<i>c</i>/<i>d</i>). This is the usual default. </td></tr>
<tr valign="top"><td>VMF </td>
<td>Change default verification mode to floating-point. </td></tr>
<tr valign="top"><td>0J, 3J, 6J, 9J </td>
<td>Calculate a Wigner 3j, 6j or 9j symbol and put it on the stack. 0J
calculates a 3j symbol for which all <i>m</i> values are zero. The full input
for these commands takes the form: 
<ul>
<li>0J j1 j2 j3 </li>
<li>3J j1 j2 j3 m1 m2 m3 </li>
<li>6J j1 j2 j3 l1 l2 l3 </li>
<li>9J a b c d e f g h i </li>
</ul>
where each argument is integer or integer/2 (integers only for 0J)
and all arguments must appear on the same line separated by one or
more spaces. </td></tr>
<tr valign="top"><td>POP </td>
<td>Delete the top member from the stack. </td></tr>
<tr valign="top"><td>PUSH </td>
<td>Push the stack down, copying the top member. PUSHing an empty
stack inserts zero. </td></tr>
<tr valign="top"><td>CLR,CLEAR </td>
<td>Clear the stack. </td></tr>
<tr valign="top"><td>PROMPT&nbsp;&#8216;<i>string</i>&#8217; </td>
<td>Set prompt string. The string is output when the program is ready
for the next line of commands. The default string is &#8216;:&#8217;.
A null string may be set. </td></tr>
<tr valign="top"><td>ECHO+ </td>
<td>Reflect each input line before obeying any commands. </td></tr>
<tr valign="top"><td>ECHO- </td>
<td>Do not reflect input lines (default). </td></tr>
<tr valign="top"><td>( </td>
<td>Ignore rest of line. </td></tr>
<tr valign="top"><td>? </td>
<td>Give a summary of the available commands. </td></tr>
<tr valign="top"><td>QUIT, Q </td>
<td>Quit. </td></tr>
</table>

</div>
<!--		Ends Here			-->

<div id="foot">
<!--#config timefmt="%d %B, %Y" -->
<p>This page is maintained by
<a href="mailto:ajs1 at cam dot ac dot uk">Anthony Stone</a>,
and was last updated on <!--#flastmod file="rrfcalc.html" -->. </p>
</div>
<div id="w3valid">
<p>
    <a href="http://validator.w3.org/check?uri=referer"><img
      src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
  </p>
</div>
</body>
</html>
